﻿

using System;
using System.Threading.Tasks;
using System.Linq.Expressions;

using Oliving.Edge.Model;
using Oliving.Edge.Model.Dto;
using Oliving.Edge.Model.Models;
using Oliving.Edge.IServices;
using Oliving.Edge.IRepository;
using Oliving.Edge.Services.BASE;
using Oliving.Edge.Model.Dto.DTSN;
using Oliving.Edge.Model.DTSN;
using Oliving.Edge.IRepository.DTSN;
using Oliving.Edge.IServices.DTSN;
using System.Collections.Generic;
using Oliving.Edge.Model.ViewModels.ReportDto;
using Oliving.Edge.Model.ViewModels.DTSN;

namespace Oliving.Edge.Services.DTSN
{
    public partial class DTSN_CanningRecordServices : BaseServices<DTSN_CanningRecord>, IDTSN_CanningRecordServices
    {
        IDTSN_CanningRecordRepository _dal;
        public DTSN_CanningRecordServices(IDTSN_CanningRecordRepository dal)
        {
            this._dal = dal;
            base.BaseDal = dal;
        }



        public async Task<PageModel<DTSN_CanningRecordPageDto>> QueryPageList(
            Expression<Func<DTSN_CanningRecord, bool>> whereExpression,
            int pageIndex = 1, int pageSize = 20,
            string sortField = null, string sortOrder = null
            )
        {
            var page = await _dal.QueryPageList(
                whereExpression,
                pageIndex, pageSize,
                    sortField, sortOrder);
            return page;
        }

        public async Task<List<ChartDto>> ReportChart(Expression<Func<DTSN_CanningRecord, bool>> whereExpression)
        {

            var page = await _dal.ReportChart(whereExpression);
            return page;
        }

        public async Task<List<DTSN_ReportTongDaoDto>> ReportTongDao(Expression<Func<DTSN_CanningRecord, bool>> whereExpression)
        { 
            var page = await _dal.ReportTongDao(whereExpression);
            return page;
        }



    }
}

